import TSMap from "../math/TSMap";

export default class RedTipInfo {


    private key: string;
    private data:TSMap = new TSMap();
    constructor(key){
        this.key  = key;
    }

    getKey(){
        return this.key;
    }

    getData(){
        return this.data;
    }

    has(key){
        return this.data.has(key);
    }

    add(obj){
        // cc.log(" obj ",obj);
        if(!this.data.has(obj)){
            this.data.set(obj,obj);
            return true;
        }
        return false;
    }

    delete(obj){
        if(this.data.has(obj)){
            this.data.delete(obj);
            return true;
        }        
        return false;
    }

    getCount(){
        return this.data.size();
    }

    clear(){
        this.data.clear();
    }

}
